package pe.gob.sunat.georeferencia.model.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.SqlMapClientTemplate;
import pe.gob.sunat.georeferencia.model.dao.MaestroDirecDAO;
import pe.gob.sunat.georeferencia.model.domain.MaestroDirec;
import pe.gob.sunat.georeferencia.model.domain.MaestroDirecCriteria;
import pe.gob.sunat.georeferencia.model.domain.MaestroDirecKey;

@SuppressWarnings("deprecation")
public class MaestroDirecDAOImpl extends SqlMapClientDaoSupport implements MaestroDirecDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public MaestroDirecDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int countByExample(MaestroDirecCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("t0003maes_dire.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int deleteByExample(MaestroDirecCriteria example) {
        int rows = getSqlMapClientTemplate().delete("t0003maes_dire.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int deleteByPrimaryKey(MaestroDirecKey key) {
        int rows = getSqlMapClientTemplate().delete("t0003maes_dire.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public void insert(MaestroDirec record) {
        getSqlMapClientTemplate().insert("t0003maes_dire.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public void insertSelective(MaestroDirec record) {
        getSqlMapClientTemplate().insert("t0003maes_dire.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    @SuppressWarnings("unchecked")
    public List<MaestroDirec> selectByExample(MaestroDirecCriteria example) {
        List<MaestroDirec> list = getSqlMapClientTemplate().queryForList("t0003maes_dire.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public MaestroDirec selectByPrimaryKey(MaestroDirecKey key) {
        MaestroDirec record = (MaestroDirec) getSqlMapClientTemplate().queryForObject("t0003maes_dire.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int updateByExampleSelective(MaestroDirec record, MaestroDirecCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t0003maes_dire.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int updateByExample(MaestroDirec record, MaestroDirecCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t0003maes_dire.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int updateByPrimaryKeySelective(MaestroDirec record) {
        int rows = getSqlMapClientTemplate().update("t0003maes_dire.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    public int updateByPrimaryKey(MaestroDirec record) {
        int rows = getSqlMapClientTemplate().update("t0003maes_dire.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table t0003maes_dire
     *
     * @ibatorgenerated
     */
    private static class UpdateByExampleParms extends MaestroDirecCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, MaestroDirecCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}